package com.kingsoft.miot.bridge.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.kingsoft.miot.bridge.dao.AreaInfoDao;
import com.kingsoft.miot.bridge.exception.CommonException;
import com.kingsoft.miot.bridge.pojo.pub.AreaInfo;
import com.kingsoft.miot.bridge.service.AreaService;

@Service
public class AreaServiceImpl implements AreaService {

	@Autowired
	private AreaInfoDao areaDao;

	/**
	 * 获得所有信息
	 */
	@Override
	public List<AreaInfo> getAll() {
		try {
			return areaDao.getAll();
		} catch (Exception e) {
			throw new CommonException(e);
		}
	}

	@Override
	public AreaInfo getByAreaInfoName(String area_name) {
		try {
			return areaDao.getByAreaInfoName(area_name);
		} catch (Exception e) {
			throw new CommonException(e);
		}
	}

	@Override
	public AreaInfo getById(int area_info_id) {
		try {
			return areaDao.getById(area_info_id);
		} catch (Exception e) {
			throw new CommonException(e);
		}
	}

}
